<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/framework/web/common_web.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>乐驴网-用户信息</title>
</head>
<body>
	<table width="60%" align="center">
			<tr>
				<td colspan="2">
					<img src="<%=request.getContextPath()%>/framework/images/logo_new.jpg"/>|<span style="font-size: 20px">我的乐驴</span>|
					<span style="font-size: 12px"><a href="index.action">返回主页</a></span>
					<hr>
				</td>
			</tr>
			<tr height="400px" valign="top">
				<td class="keyword" width="20%">
					<ul>
						<li><a href="#">个人资料</a></li>
						<li><a href="getRoutesByUser?user.userId=<s:property value="#session['userId']"/>">我的路线</a></li>
					</ul>
				</td>
				<td class="keyword" align="center">
					<table width="100%" class="articleBg">
						<tr>
							<td colspan="3">UID：<s:property value="user.userId"/></td>
						</tr>
						<tr>
							<td colspan="3">用户名:<s:property value="user.userName"/></td>
						</tr>
						<tr>
							<td colspan="3">余额：<input id="userMoney" type="text" readonly="readonly" value="<s:property value="user.Money"/>"></td>
						</tr>
						<tr>
							<td colspan="3"><input id="b2" type="submit" value="修改密码">|<input type="button" value="充值" id="b1"></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<div id="d1" style="z-index:10; width:300px;height:125px;display: none;border-right: 1px solid #4AAE00;border-left: 1px solid #4AAE00;border-bottom: 1px solid #4AAE00;border-top: 1px solid #4AAE00;background:-webkit-gradient(linear, 0 0, 0 bottom, from(#FFFFFF), to(#F0F0F0));">
			<table align="center">
				<tr>
					<td>卡号:<input type="text"></td>
				</tr>
				<tr>
					<td>密码:<input type="password"></td>
				</tr>
				<tr>
					<td>
						金额:<input type="text" id="put1">
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="button" value="确定" id="payok">
					    <input type="button" value="关闭" id="closeD1">
					</td>
				</tr>
			</table>
		</div>
		<div id="d2" style="z-index:10; width:300px;height:65px;display: none;border-right: 1px solid #4AAE00;border-left: 1px solid #4AAE00;border-bottom: 1px solid #4AAE00;border-top: 1px solid #4AAE00;background:-webkit-gradient(linear, 0 0, 0 bottom, from(#FFFFFF), to(#F0F0F0));">
			<table align="center">
				<tr>
					<td>
						新密码:<input type="text" id="put2">
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="button" value="确定" id="changeok">
					    <input type="button" value="关闭" id="closeD2">
					</td>
				</tr>
			</table>
		</div>
		<script>
			$(document).ready(function(){
				var d1 = $("#d1");
				var d2 = $("#d2");
				$("#b1").click(function(){
					d1.center();
				});
				$("#closeD1").click(function(){
					d1.hidden();
				});
				$("#b2").click(function(){
					d2.center();
				});
				$("#closeD2").click(function(){
					d2.hidden();
				});
				$("#payok").click(function(){
					var m = $("#put1").val();
					if(m == ""){
						alert("请输入金额！");
						return
					}else{
						$.post(
							"updateUserMoney.action?user.money="+m+"&user.userId="+<%=session.getAttribute("userId")%>,
							function(data){
								alert(data.user.money);
								$("#userMoney").val(data.user.money);
							}
						);
					}
				});
				$("#changeok").click(function(){
					var p = $("#put2").val();
					if(p == ""){
						alert("请输入密码！");
						return
					}else{
						$.post(
						"updateUserPwd.action?user.userPwd="+p+"&user.userId="+<%=session.getAttribute("userId")%>,
						function(data){
							alert(data);
						}
					  );
					}
				});
			});
		</script>
		<%@ include file="/website/bottom.jsp" %>
</body>
</html>